<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <script>
    // 1.创建symbol
    let s = Symbol()
    console.log(s);
    // 2.此时symbol成为一个对象
    let s1 = Symbol.for('库里')
    console.log(s1, typeof s1);
    // 3.给对象添加symbol类型的属性
    let s3 = {
      name: '库里',
      [Symbol('demo1')]: function () {
        console.log('你是傻子');
      },
      [Symbol('demo2')]: function () {
        console.log('我不是傻子');
      }
    }
    console.log(s3);
  </script>
</body>

</html>